Optimal. Leaf size=99 \[ \frac {2 a^2 (i A+B) c^5 (1-i \tan (e+f x))^5}{5 f}-\frac {a^2 (i A+3 B) c^5 (1-i \tan (e+f x))^6}{6 f}+\frac {a^2 B c^5 (1-i \tan (e+f x))^7}{7 f} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.13, antiderivative size = 99, normalized size of antiderivative = 1.00, number of steps
used = 3, number of rules used = 2, integrand size = 41, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.049, Rules used = {3669, 78}
\begin {gather*} -\frac {a^2 c^5 (3 B+i A) (1-i \tan (e+f x))^6}{6 f}+\frac {2 a^2 c^5 (B+i A) (1-i \tan (e+f x))^5}{5 f}+\frac {a^2 B c^5 (1-i \tan (e+f x))^7}{7 f} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 78
Rule 3669
Rubi steps
\begin {align*} \int (a+i a \tan (e+f x))^2 (A+B \tan (e+f x)) (c-i c \tan (e+f x))^5 \, dx &=\frac {(a c) \text {Subst}\left (\int (a+i a x) (A+B x) (c-i c x)^4 \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac {(a c) \text {Subst}\left (\int \left (2 a (A-i B) (c-i c x)^4-\frac {a (A-3 i B) (c-i c x)^5}{c}-\frac {i a B (c-i c x)^6}{c^2}\right ) \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac {2 a^2 (i A+B) c^5 (1-i \tan (e+f x))^5}{5 f}-\frac {a^2 (i A+3 B) c^5 (1-i \tan (e+f x))^6}{6 f}+\frac {a^2 B c^5 (1-i \tan (e+f x))^7}{7 f}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] Both result and optimal contain complex but leaf count is larger than twice
the leaf count of optimal. \(254\) vs. \(2(99)=198\).
time = 1.90, size = 254, normalized size = 2.57 \begin {gather*} \frac {a^2 c^5 \sec (e) \sec ^7(e+f x) (35 (-7 i A+3 B) \cos (f x)+35 (-7 i A+3 B) \cos (2 e+f x)-105 i A \cos (2 e+3 f x)+105 B \cos (2 e+3 f x)-105 i A \cos (4 e+3 f x)+105 B \cos (4 e+3 f x)+245 A \sin (f x)+105 i B \sin (f x)-245 A \sin (2 e+f x)-105 i B \sin (2 e+f x)+189 A \sin (2 e+3 f x)+21 i B \sin (2 e+3 f x)-105 A \sin (4 e+3 f x)-105 i B \sin (4 e+3 f x)+98 A \sin (4 e+5 f x)+42 i B \sin (4 e+5 f x)+14 A \sin (6 e+7 f x)+6 i B \sin (6 e+7 f x))}{840 f} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.14, size = 147, normalized size = 1.48
method | result | size |
risch | \(\frac {32 c^{5} a^{2} \left (42 i A \,{\mathrm e}^{4 i \left (f x +e \right )}+42 B \,{\mathrm e}^{4 i \left (f x +e \right )}+49 i A \,{\mathrm e}^{2 i \left (f x +e \right )}-21 B \,{\mathrm e}^{2 i \left (f x +e \right )}+7 i A -3 B \right )}{105 f \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )^{7}}\) | \(83\) |
derivativedivides | \(-\frac {i c^{5} a^{2} \left (-\frac {B \left (\tan ^{7}\left (f x +e \right )\right )}{7}+\frac {\left (-3 i B -A \right ) \left (\tan ^{6}\left (f x +e \right )\right )}{6}+\frac {\left (i A +4 i \left (i B -A \right )+6 B \right ) \left (\tan ^{5}\left (f x +e \right )\right )}{5}+\frac {\left (-2 i B +2 A \right ) \left (\tan ^{4}\left (f x +e \right )\right )}{4}+\frac {\left (-6 i A -4 i \left (i B -A \right )-B \right ) \left (\tan ^{3}\left (f x +e \right )\right )}{3}+\frac {\left (i B +3 A \right ) \left (\tan ^{2}\left (f x +e \right )\right )}{2}+i A \tan \left (f x +e \right )\right )}{f}\) | \(147\) |
default | \(-\frac {i c^{5} a^{2} \left (-\frac {B \left (\tan ^{7}\left (f x +e \right )\right )}{7}+\frac {\left (-3 i B -A \right ) \left (\tan ^{6}\left (f x +e \right )\right )}{6}+\frac {\left (i A +4 i \left (i B -A \right )+6 B \right ) \left (\tan ^{5}\left (f x +e \right )\right )}{5}+\frac {\left (-2 i B +2 A \right ) \left (\tan ^{4}\left (f x +e \right )\right )}{4}+\frac {\left (-6 i A -4 i \left (i B -A \right )-B \right ) \left (\tan ^{3}\left (f x +e \right )\right )}{3}+\frac {\left (i B +3 A \right ) \left (\tan ^{2}\left (f x +e \right )\right )}{2}+i A \tan \left (f x +e \right )\right )}{f}\) | \(147\) |
norman | \(\frac {A \,a^{2} c^{5} \tan \left (f x +e \right )}{f}-\frac {\left (-i A \,a^{2} c^{5}+3 B \,a^{2} c^{5}\right ) \left (\tan ^{6}\left (f x +e \right )\right )}{6 f}-\frac {\left (2 i B \,a^{2} c^{5}+3 A \,a^{2} c^{5}\right ) \left (\tan ^{5}\left (f x +e \right )\right )}{5 f}-\frac {\left (3 i B \,a^{2} c^{5}+2 A \,a^{2} c^{5}\right ) \left (\tan ^{3}\left (f x +e \right )\right )}{3 f}+\frac {\left (-3 i A \,a^{2} c^{5}+B \,a^{2} c^{5}\right ) \left (\tan ^{2}\left (f x +e \right )\right )}{2 f}-\frac {\left (i A \,a^{2} c^{5}+B \,a^{2} c^{5}\right ) \left (\tan ^{4}\left (f x +e \right )\right )}{2 f}+\frac {i B \,a^{2} c^{5} \left (\tan ^{7}\left (f x +e \right )\right )}{7 f}\) | \(203\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.51, size = 158, normalized size = 1.60 \begin {gather*} \frac {30 i \, B a^{2} c^{5} \tan \left (f x + e\right )^{7} + 35 \, {\left (i \, A - 3 \, B\right )} a^{2} c^{5} \tan \left (f x + e\right )^{6} - 42 \, {\left (3 \, A + 2 i \, B\right )} a^{2} c^{5} \tan \left (f x + e\right )^{5} + 105 \, {\left (-i \, A - B\right )} a^{2} c^{5} \tan \left (f x + e\right )^{4} - 70 \, {\left (2 \, A + 3 i \, B\right )} a^{2} c^{5} \tan \left (f x + e\right )^{3} + 105 \, {\left (-3 i \, A + B\right )} a^{2} c^{5} \tan \left (f x + e\right )^{2} + 210 \, A a^{2} c^{5} \tan \left (f x + e\right )}{210 \, f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 3.44, size = 161, normalized size = 1.63 \begin {gather*} -\frac {32 \, {\left (42 \, {\left (-i \, A - B\right )} a^{2} c^{5} e^{\left (4 i \, f x + 4 i \, e\right )} + 7 \, {\left (-7 i \, A + 3 \, B\right )} a^{2} c^{5} e^{\left (2 i \, f x + 2 i \, e\right )} + {\left (-7 i \, A + 3 \, B\right )} a^{2} c^{5}\right )}}{105 \, {\left (f e^{\left (14 i \, f x + 14 i \, e\right )} + 7 \, f e^{\left (12 i \, f x + 12 i \, e\right )} + 21 \, f e^{\left (10 i \, f x + 10 i \, e\right )} + 35 \, f e^{\left (8 i \, f x + 8 i \, e\right )} + 35 \, f e^{\left (6 i \, f x + 6 i \, e\right )} + 21 \, f e^{\left (4 i \, f x + 4 i \, e\right )} + 7 \, f e^{\left (2 i \, f x + 2 i \, e\right )} + f\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 243 vs. \(2 (80) = 160\).
time = 0.77, size = 243, normalized size = 2.45 \begin {gather*} \frac {224 i A a^{2} c^{5} - 96 B a^{2} c^{5} + \left (1568 i A a^{2} c^{5} e^{2 i e} - 672 B a^{2} c^{5} e^{2 i e}\right ) e^{2 i f x} + \left (1344 i A a^{2} c^{5} e^{4 i e} + 1344 B a^{2} c^{5} e^{4 i e}\right ) e^{4 i f x}}{105 f e^{14 i e} e^{14 i f x} + 735 f e^{12 i e} e^{12 i f x} + 2205 f e^{10 i e} e^{10 i f x} + 3675 f e^{8 i e} e^{8 i f x} + 3675 f e^{6 i e} e^{6 i f x} + 2205 f e^{4 i e} e^{4 i f x} + 735 f e^{2 i e} e^{2 i f x} + 105 f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 191 vs. \(2 (86) = 172\).
time = 1.19, size = 191, normalized size = 1.93 \begin {gather*} -\frac {32 \, {\left (-42 i \, A a^{2} c^{5} e^{\left (4 i \, f x + 4 i \, e\right )} - 42 \, B a^{2} c^{5} e^{\left (4 i \, f x + 4 i \, e\right )} - 49 i \, A a^{2} c^{5} e^{\left (2 i \, f x + 2 i \, e\right )} + 21 \, B a^{2} c^{5} e^{\left (2 i \, f x + 2 i \, e\right )} - 7 i \, A a^{2} c^{5} + 3 \, B a^{2} c^{5}\right )}}{105 \, {\left (f e^{\left (14 i \, f x + 14 i \, e\right )} + 7 \, f e^{\left (12 i \, f x + 12 i \, e\right )} + 21 \, f e^{\left (10 i \, f x + 10 i \, e\right )} + 35 \, f e^{\left (8 i \, f x + 8 i \, e\right )} + 35 \, f e^{\left (6 i \, f x + 6 i \, e\right )} + 21 \, f e^{\left (4 i \, f x + 4 i \, e\right )} + 7 \, f e^{\left (2 i \, f x + 2 i \, e\right )} + f\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 8.68, size = 158, normalized size = 1.60 \begin {gather*} \frac {A\,a^2\,c^5\,\mathrm {tan}\left (e+f\,x\right )+\frac {a^2\,c^5\,{\mathrm {tan}\left (e+f\,x\right )}^3\,\left (-3\,B+A\,2{}\mathrm {i}\right )\,1{}\mathrm {i}}{3}+\frac {a^2\,c^5\,{\mathrm {tan}\left (e+f\,x\right )}^5\,\left (-2\,B+A\,3{}\mathrm {i}\right )\,1{}\mathrm {i}}{5}-\frac {a^2\,c^5\,{\mathrm {tan}\left (e+f\,x\right )}^2\,\left (3\,A+B\,1{}\mathrm {i}\right )\,1{}\mathrm {i}}{2}-\frac {a^2\,c^5\,{\mathrm {tan}\left (e+f\,x\right )}^4\,\left (A-B\,1{}\mathrm {i}\right )\,1{}\mathrm {i}}{2}+\frac {a^2\,c^5\,{\mathrm {tan}\left (e+f\,x\right )}^6\,\left (A+B\,3{}\mathrm {i}\right )\,1{}\mathrm {i}}{6}+\frac {B\,a^2\,c^5\,{\mathrm {tan}\left (e+f\,x\right )}^7\,1{}\mathrm {i}}{7}}{f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________